﻿<!DOCTYPE html>
<html class="x-admin-sm">

<head>
  <meta charset="UTF-8">

  <meta name="renderer" content="webkit">
  <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
  <meta name="viewport"
    content="width=device-width,user-scalable=yes, minimum-scale=0.4, initial-scale=0.8,target-densitydpi=low-dpi" />



  <link rel="stylesheet" href="./content/css/font.css">
  <link rel="stylesheet" href="./content/css/xadmin.css">
  <link rel="stylesheet" href="./content/plugin/bootstrap/css/bootstrap.min.css">
  <link rel='stylesheet' href='./content/plugin/bootstrap/css/style.css' />

  <script src="https://cdn.staticfile.org/jquery/2.1.1/jquery.min.js"></script>

  <script type="text/javascript" src="./content/js/xadmin.js"></script>
  <script type="text/javascript" src="./content/js/cookie.js"></script>
  <script src="./content/lib/layui/layui.js" charset="utf-8"></script>





</head>

<body>
  <div id="app">
    <div class="x-nav">

      <span class="nav-header">
        <a href="">首页</a>>
        <a href="">修改密码</a>

      </span>

    </div>
    <div class="x-body">
      <fieldset>
        <div class="control-group">
          <label for="input01" class="control-label">新密码</label>
          <div class="controls">
            <input placeholder="" type="text" class="form-control" v-model="user.pass1">
          </div>
        </div>

        <div class="control-group">
          <label for="input01" class="control-label">确认密码</label>
          <div class="controls">
            <input placeholder="" type="text" class="form-control" v-model="user.pass2">
          </div>
        </div>

      </fieldset>
      <div class="modal-footer">

        <button type="button" class="btn btn-primary" v-on:click="save()">确认</button>
      </div>

    </div>





  </div>
  <link href="./content/plugin/sweetalert/sweetalert.css" rel="stylesheet">
  <script src="./content/plugin/sweetalert/sweetalert.min.js"></script>
  <script src="./content/plugin/bootstrap/js/bootstrap.min.js"></script>
  <script src="./content/js/vue2.js"></script>
  <script src="./content/js/vue-nav.js"></script>
  <script src="./content/js/config.js"></script>

  <script>


    var vm = new Vue({
      el: "#app",
      data: {
        user: {}
      },
      components: {
        'vue-nav': Vnav
      },
      methods: {
        save: function (addobj) {
          var self = this;
          var userid = localStorage.getItem("userid");
          $.post(apiurl + "/admin/updatepass", { userid: userid, password: this.user.pass1 }, function (data) {

            if (data.status == "200") {
              swal("success", "操作成功", "success");
            } else {
              swal("error", data.message, "error");
            }

          });
        },


      },
      created: function () {  //初始化事件里边去调用查询方法




      }
    });


  </script>
</body>

</html>